<%-- 
    Document   : getdealer
    Created on : Jun 13, 2012, 8:19:45 PM
    Author     : praneeth
--%>
<%@page import="java.sql.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Validate Login JSP Page</title>
    </head>
    <body>
      
        <% String area1= request.getParameter("area");
            
        

       // out.println(uid);
        //out.println(pwd);
        //  out.println(role);
        
        String q1="select * from Login where Area='"+area1+"'";
      //  out.println(q1);
        Connection con=null;
        Statement stmt=null;
        ResultSet rs=null;
        
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        con=DriverManager.getConnection("jdbc:odbc:egasdsn");
        
        stmt=con.createStatement();
        rs=stmt.executeQuery(q1);
        
        if(rs.next()){
            
                           String uidfromdb= rs.getString("Area");
                           
                     //      out.println("role ui"+role);
                   //      out.println("roledb"+rolefromdb);
                                %>
        
    <!--  if(role.equals("ADMIN"){    -->
        
                                <%@include file="SearchDealer.jsp" %>
     <!--   }-->                        
        <% 
        
        out.println("<br><h4>Hi   "+area1.toUpperCase()+"</h4>");
                               
                       }
               else{
            
        %> <%@include file="refill.jsp" %>
            %>
        
        <%
            out.println("invalid user");
               }
        

            %>        
      
    </body>
</html>
